package join;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-10-09
 * Time: 11:00
 */
public class demo1 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(){
            @Override
            public void run() {
                System.out.println("t线程开始" );
                for (int i = 0; i < 10; i++) {
                    System.out.println(i);
                }
                System.out.println("t线程结束");

            }

        };
        t.start();
        t.join();
        System.out.println("main线程开始");
        System.out.println("main线程结束");
    }
}
